<?php
apf_require_controller("Api_Abstract");
class Api_DimissionUsersController extends Api_AbstractController {
    public function handle_request() {
        $bll = new Bll_Hr_OutInterface();
        $params = APF::get_instance()->get_request()->get_parameters();
        if(empty($params['start']) || empty($params['end'])){
            $this->json_encode(0,Const_ApiError::ERROR_PARAMS);
        }
        $start = $end=0;
        if($params['start'] && strlen($params['start'])==8){
            $start = $params['start'];
        }
        if($params['end'] && strlen($params['end'])==8){
            $end = $params['end'];
        }else{
            $end = date('Ymd');
        }
        $userdata = $bll->search_dimission_by_date($start,$end);
        $this->json_encode(1,$userdata);
        exit;
    }
}